package mediator;

/**
 * @Author: Doream
 * @Date: 2022/1/30 12:14
 */
// 具体的中介者角色
public class MediatorStructure extends Mediator {
    // 聚合租房者和房主
    private HouseOwner houseOwner;
    private Tenant tenant;
    @Override
    public void constact(String message, Person person) {
        if (person == houseOwner){
            tenant.getMessage(message);
        }else {
            houseOwner.getMessage(message);
        }
    }

    public HouseOwner getHouseOwner() {
        return houseOwner;
    }

    public void setHouseOwner(HouseOwner houseOwner) {
        this.houseOwner = houseOwner;
    }

    public Tenant getTenant() {
        return tenant;
    }

    public void setTenant(Tenant tenant) {
        this.tenant = tenant;
    }
}
